package com.eascs.web.o2o.web.controller;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.eascs.site.controller.BaseRestController;
import com.eascs.site.view.BaseRestResult;
import com.eascs.web.o2o.web.entity.Account;
import com.eascs.web.o2o.web.entity.User;
import com.eascs.web.o2o.web.entity.UserInfo;

@RestController
@RequestMapping("/app")
public class AppTestController extends BaseRestController{

	@RequestMapping("/query")
	public BaseRestResult<User> queryUserInfo(){
		User user=new User();
		Account account=new Account();
		account.setName("王天赐");
		user.setAccount(account);
		user.setAge(25);
		user.setBigdecimal1(new BigDecimal(20));
		user.setBoolean1(false);
		user.setBtye1((byte) 1);
		user.setChar1('a');
		user.setDouble1(121.1D);
		user.setFloat1(121.1F);
		user.setLong1((long) 121);
		user.setShort1((short) 2);
		user.setUserName("系统管理员");
		List<UserInfo> list=new ArrayList<UserInfo>();
		for (int i = 0; i < 4; i++) {
			UserInfo info =new UserInfo();
			info.setAddress("深圳"+i);
			info.setEmail("766029700@qq.com"+i);
			list.add(info);
		}
		user.setList(list);
		BaseRestResult<User> result = BaseRestResult.buildRestResult(user);
		return result;
	}
}
